package com.wanxi.config;

import com.wanxi.Fuzhuang061017Application;
import com.wanxi.controller.MessageController;
import com.wanxi.controller.ProductController;
import com.wanxi.dao.MessageDao;
import com.wanxi.dao.ProductDao;
import com.wanxi.listener.SuperAdminMqListener;
import com.wanxi.model.MessageModel;
import com.wanxi.model.ProductModel;
import com.wanxi.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

import java.util.List;

/**
 * @Author:Doteon
 * @createDate:2023/3/15
 * @version: 1.0
 */
@Configuration
public class ScheduleTask {
    @Autowired
    ProductController productController;
    /**
     * 每隔1分钟执行一次查询，如果监测有变化，则进行重启
     */
    @Scheduled(fixedRate = 60000)
    private void configureTasks() {
        ProductModel productModel=new ProductModel();
        System.out.println(productController.importEsByContent(productModel));
    }
}
